-- local augroup = vim.api.nvim_create_augroup
-- autocmd("TermClose", {
--   pattern = "*lazygit*",
--   desc = "Refresh Neo-Tree filesystem when closing lazygit",
--   group = augroup("neotree_fs_refresh", { clear = true }),
--   callback = function()
--     if package.loaded["neo-tree.sources.manager"] then require("neo-tree.sources.manager").refresh("filesystem") end
--   end,
-- })
vim.api.nvim_create_autocmd("FileType", { pattern = "json", command = "set filetype=jsonc" })
vim.api.nvim_create_autocmd("FileType", { pattern = "zsh", command = "set filetype=sh" })

vim.api.nvim_create_autocmd({ "InsertLeave", "CmdlineEnter" }, {
  pattern = { "*" },
  callback = function()
    if vim.loop.os_uname().sysname == "Darwin" then
      if vim.fn.executable "im-select" == 1 then vim.cmd "silent !im-select com.apple.keylayout.ABC" end
    end
  end,
})
